package com.t.bricks.bussiness.service.registuser.impl;

import org.springframework.stereotype.Service;

import com.t.bricks.bussiness.db.entity.registuser.RegistUser;
import com.t.bricks.bussiness.service.registuser.RegistUserService;
import com.t.bricks.model.MsgEmity;

/**
 * 注册用户'RegistUser表'基本业务操作类接口实现
 * @author HuangXinBian
 * @DateTime 2021年09月07日 13:28:01
 */
@Service
public class RegistUserServiceImpl implements RegistUserService<RegistUser> {

	/**
	 * 拉取用户信息
	 * @param registUser
	 * @return
	 */
	@Override
	public MsgEmity retrieveUser(RegistUser registUser) {
		if (null == registUser) {
			return MsgEmity.err(8001, "参数为空");
		}
		
		if (null == registUser.getsName() || "".equals(registUser.getsName().trim())) {
			return MsgEmity.err(8002, "用户名为空");
		}
		
		if (null == registUser.getsNo() || "".equals(registUser.getsNo().trim())) {
			return MsgEmity.err(8003, "电话号为空");
		}
		
		if (null == registUser.getsQuestion1() || "".equals(registUser.getsQuestion1().trim())) {
			return MsgEmity.err(8004, "为空");
		}
		
		if (null == registUser.getsOwner() || "".equals(registUser.getsOwner().trim())) {
			return MsgEmity.err(8005, "来源为空");
		}
		
		return this.findByKey(registUser, false);
	}

}
